package com.woniuxy.portal.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.common.consts.RedisConst;
import com.woniuxy.portal.model.entity.China;
import com.woniuxy.portal.service.ChinaService;
import com.woniuxy.portal.mapper.ChinaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author HASEE
 * @description 针对表【t_china】的数据库操作Service实现
 * @createDate 2025-08-06 04:33:28
 */
@Service
public class ChinaServiceImpl extends ServiceImpl<ChinaMapper, China> implements ChinaService {

    private final ChinaMapper chinaMapper;

    @Autowired
    public ChinaServiceImpl(ChinaMapper chinaMapper) {
        this.chinaMapper = chinaMapper;
    }

    @Cacheable(cacheNames = RedisConst.CHINA_CACHE, key = "#id")
    @Override
    public China findById(Integer id) {
        return chinaMapper.selectById(id);
    }

}




